package org.vt.ece3574.pictoslider;

import org.vt.ece3574.pictoslider.menus.Themes;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

/**
 * This class represents the pop-up window that appears when the user pauses the
 * game.
 * 
 * @author Michael
 * 
 */
public class PausePopUpWindow extends Activity {

	/**
	 * String Key for a boolean passed in an intent. Lets GameScreen know if the
	 * user wishes to quit playing or not.
	 */
	public static final String QUIT = "Quit";

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.app.Activity#onCreate(android.os.Bundle)
	 */
	@Override
	public void onCreate(Bundle SavedInstanceState) {
		super.onCreate(SavedInstanceState);
		Themes.onActivityCreateSetTheme(this);
		Themes.onActivityCreateSetContentView(this, R.layout.pause_popup);

		((TextView) findViewById(R.id.textView1)).setTextColor(Themes
				.textColor(this));
	}

	/**
	 * OnClickHandler for the Resume Button.
	 * 
	 * @param v
	 *            - The view which was clicked.
	 */
	public void onResumeClicked(View v) {
		Intent i = new Intent();
		i.putExtra(QUIT, false);
		setResult(Activity.RESULT_OK, i);
		this.finish();
	}

	/**
	 * OnClickHandler for the Quit Button.
	 * 
	 * @param v
	 *            - The view which was clicked.
	 */
	public void onQuitClicked(View v) {
		Intent i = new Intent();
		i.putExtra(QUIT, true);
		setResult(Activity.RESULT_OK, i);
		this.finish();
	}
}
